package org.groupg.project.config;


import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;

import java.util.List;

public class XmlPortConfig {
    @JacksonXmlProperty(isAttribute = true, localName = "number")
    private int number;

    @JacksonXmlProperty(localName = "rules")
    private RulesWrapper rulesWrapper;

    public XmlPortConfig() {}

    public XmlPortConfig(int number, List<RuleConfig> rules) {
        this.number = number;
        this.rulesWrapper = new RulesWrapper(rules);
    }

    // Getters and Setters
    public int getNumber() {
        return number;
    }

    public List<RuleConfig> getRules() {
        return rulesWrapper != null ? rulesWrapper.getRules() : null;
    }
}